﻿CREATE PROCEDURE [maint].[IsFullBackupRequired]
@DbName [sysname], @Required BIT OUTPUT, @OutputDiagnostics BIT=0
AS
BEGIN
	IF(@OutputDiagnostics = 1)
		BEGIN
			PRINT OBJECT_NAME(@@PROCID)
			PRINT N'	@DbName = N''' + ISNULL(@DbName,N'NULL') + ''''
		END
			
	DECLARE @IsStdBackup bit, @IsSnapshotBackup bit
	SELECT @IsStdBackup = 0, @IsSnapshotBackup = 0
	EXEC [maint].[CheckLastFullBackupType]
		@DbName
		,@IsStdBackup OUTPUT
		,@IsSnapshotBackup OUTPUT
		,@OutputDiagnostics
		
	IF (@IsStdBackup = 0)
		SET @Required = 1;
	ELSE
		SET @Required = 0;

	RETURN(0)
END